Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-11127] Write OrganizationInstallation record when license is retrieved #5090

Conversation

amorask-bitwarden
Copy link
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-11127

📔 Objective

The goal of this PR is to:

  1. Create a new table called OrganizationInstallation that's a relational table between Organization and Installation
  2. Create a new record in this table when a user downloads their organization license for the first time
  3. Update an existing record to set the RevisionDate when the user downloads their organization license after already having done so once

📸 Screenshots

Screen.Recording.2024-11-26.at.2.29.46.PM.mov

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@amorask-bitwarden amorask-bitwarden requested review from a team as code owners November 26, 2024 19:34
Copy link
Contributor

github-actions bot commented Nov 26, 2024

Logo
Checkmarx One – Scan Summary & Detailsb7157392-41f1-4da4-854a-d8205062f9ef

New Issues

Severity Issue Source File / Package Checkmarx Insight
LOW Missing_CSP_Header /src/Core/MailTemplates/Handlebars/AdminConsole/OrganizationUserRevokedForSingleOrgPolicy.html.hbs: 5 Attack Vector

Fixed Issues

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 106
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 238
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 362
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 345
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 264
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 306

Copy link

codecov bot commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 23.15789% with 73 lines in your changes missing coverage. Please review.

Project coverage is 43.11%. Comparing base (193f8d6) to head (37f0fdb).
Report is 40 commits behind head on main.

Files with missing lines Patch % Lines
...Repositories/OrganizationInstallationRepository.cs 0.00% 22 Missing ⚠️
...Repositories/OrganizationInstallationRepository.cs 0.00% 19 Missing ⚠️
...Api/Billing/Controllers/OrganizationsController.cs 10.00% 18 Missing ⚠️
.../Core/Billing/Entities/OrganizationInstallation.cs 0.00% 11 Missing ⚠️
...amework/Billing/Models/OrganizationInstallation.cs 66.66% 2 Missing ⚠️
...ucture.Dapper/DapperServiceCollectionExtensions.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5090      +/-   ##
==========================================
- Coverage   43.14%   43.11%   -0.04%     
==========================================
  Files        1424     1429       +5     
  Lines       65094    65188      +94     
  Branches     5964     5967       +3     
==========================================
+ Hits        28085    28106      +21     
- Misses      35756    35829      +73     
  Partials     1253     1253              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@cturnbull-bitwarden cturnbull-bitwarden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean and simple. Good stuff

@rkac-bw
Copy link
Contributor

rkac-bw commented Dec 2, 2024

Can we set this to not update more than once in a 24 hour period?

@amorask-bitwarden
Copy link
Contributor Author

Can we set this to not update more than once in a 24 hour period?

Hi @rkac-bw, can you expound on what you mean? I'm a bit confused.

Copy link
Contributor

@rkac-bw rkac-bw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@amorask-bitwarden amorask-bitwarden merged commit 2d891b3 into main Dec 11, 2024
56 checks passed
@amorask-bitwarden amorask-bitwarden deleted the billing/PM-11127/update-installation-when-license-is-created-updated branch December 11, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants